<!--
 * @Author: your name
 * @Date: 2021-08-24 22:22:45
 * @LastEditTime: 2021-08-25 15:57:43
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \briup\5-javascript\day02\6-素数.html
-->
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        var sum = 0;
        for (var i = 101; i <= 200; i++) {
            let tf = true;
            for (j = 2; j < i; j++) {
                if (i % j == 0) {
                    tf = false; //不是素数
                }
            }
            if (tf) {
                console.log(i);
                sum++;
            }
        }
        console.log(sum);
    </script>
</head>

<body>

</body>

</html>

</html>